package com.drawquest.gui;

import com.drawquest.gui.panels.MainPanel;
import com.gooddies.swing.swypepanel.SwypePanel;
import com.gooddies.wiring.Wiring;
import com.gooddies.wiring.annotations.PostWiring;
import com.gooddies.wiring.annotations.WiringComponent;
import java.awt.Color;
import javax.swing.JPanel;

@WiringComponent(singleton = true, lazy = true)
public class MainFrame extends javax.swing.JFrame {
    private final SwypePanel swypePanel;

    public MainFrame() {
        swypePanel = new SwypePanel();
        getContentPane().add(swypePanel);
        ((JPanel) getContentPane()).setBackground(Color.WHITE);
        ((JPanel) getContentPane()).setOpaque(true);
        Wiring.get().addPrimitiveComponent("SwypePanel", swypePanel);
        setTitle("Draw Quest");
    }

    @PostWiring
    private void init() {
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        swypePanel.pushComponent(Wiring.getComponent(MainPanel.class));
        pack();
    }
}
